package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AccessoryInfoMapper;
import com.ruoyi.system.domain.AccessoryInfo;
import com.ruoyi.system.service.IAccessoryInfoService;

/**
 * 配件信息Service业务层处理
 * 
 * @author LK
 * @date 2024-06-22
 */
@Service
public class AccessoryInfoServiceImpl implements IAccessoryInfoService 
{
    @Autowired
    private AccessoryInfoMapper accessoryInfoMapper;

    /**
     * 查询配件信息
     * 
     * @param accessoryId 配件信息主键
     * @return 配件信息
     */
    @Override
    public AccessoryInfo selectAccessoryInfoByAccessoryId(String accessoryId)
    {
        return accessoryInfoMapper.selectAccessoryInfoByAccessoryId(accessoryId);
    }

    /**
     * 查询配件信息列表
     * 
     * @param accessoryInfo 配件信息
     * @return 配件信息
     */
    @Override
    public List<AccessoryInfo> selectAccessoryInfoList(AccessoryInfo accessoryInfo)
    {
        return accessoryInfoMapper.selectAccessoryInfoList(accessoryInfo);
    }

    /**
     * 新增配件信息
     * 
     * @param accessoryInfo 配件信息
     * @return 结果
     */
    @Override
    public int insertAccessoryInfo(AccessoryInfo accessoryInfo)
    {
        UUID uuid = UUID.randomUUID();
        accessoryInfo.setAccessoryId(String.valueOf(uuid));
        return accessoryInfoMapper.insertAccessoryInfo(accessoryInfo);
    }

    /**
     * 修改配件信息
     * 
     * @param accessoryInfo 配件信息
     * @return 结果
     */
    @Override
    public int updateAccessoryInfo(AccessoryInfo accessoryInfo)
    {
        return accessoryInfoMapper.updateAccessoryInfo(accessoryInfo);
    }

    /**
     * 批量删除配件信息
     * 
     * @param accessoryIds 需要删除的配件信息主键
     * @return 结果
     */
    @Override
    public int deleteAccessoryInfoByAccessoryIds(String[] accessoryIds)
    {
        return accessoryInfoMapper.deleteAccessoryInfoByAccessoryIds(accessoryIds);
    }

    /**
     * 删除配件信息信息
     * 
     * @param accessoryId 配件信息主键
     * @return 结果
     */
    @Override
    public int deleteAccessoryInfoByAccessoryId(String accessoryId)
    {
        return accessoryInfoMapper.deleteAccessoryInfoByAccessoryId(accessoryId);
    }
}
